<template>
	<div class="search-con cards" >
		<!-- <div class="card demo-card-header-pic" v-for="item in searchj.cardsList"> -->
		<router-link to="/searchlink">
		<div class="card demo-card-header-pic" v-for="item in cardsList" v-on:click="conFn(item.id)">
			<!-- <a href="###" target="_blank" v-bind:href="item.href"> -->
			<a>
			    <div valign="bottom" class="card-header color-white no-border no-padding">
			       	<img class='card-cover' v-bind:src="item.imgsrc" alt="">
			    </div>
			    <div class="card-content">
				    <div class="card-content-inner">
				    <h3>{{item.title}}</h3>
				        <p class="color-gray">{{item.content}}</p>
				    </div>
			    </div>
			    <div class="card-footer">
				    <div class="link">
				      	<img class="card-footer-img" v-bind:src="item.tximg">
				      	<span class="color-gray card-footer-left">{{item.username}}</span>
				    </div>
				    <div class="link">
				      	<p class="color-gray">{{item.time}}</p>
				    </div>
			    </div>
			</a>
		</div>
		</router-link>
	</div>
</template>
<script type="text/javascript">
	export default {
		data(){
			return{
				// searchj:global.searchj
				cardsList:{}
			}
		},
		methods:{
			conFn:function(link){
				localStorage.setItem("conLink",link);
			}
		},
		mounted(){
		var _this=this;
		var txt=localStorage.getItem("bannerTxt");
			$.ajax({
				type:"get",
				url:"http://localhost:8088/shop2/searchp.php",
				data:{type:"con"},
				dataType:"json",
				success:function(data){
					console.log(data);
					_this.cardsList=data.data;
				}
			});
		}
	}
</script>
<style type="text/css">
.search-con a{
	color: black;
}
	.card{
		margin: 0.5rem 0;
		padding: 0.5rem;
	}
	.card-banner{
		margin-top: 0;
		padding: 0;
	}
	.card-footer-left{
		display: inline-block;
		padding-left: 0.5rem;
	}
	.card-footer-img{
		width: 1.5rem;
		border-radius: 50%;
	}
</style>